#!/bin/bash
dockerName="ljs-hisi3519dv500-docker"
cmd=$( basename "$0" )

function usage() {
    echo "Usage: ${cmd} [-i | -n | -h]" 
    echo "      连接docker容器"
    echo "      -n: docker容器名称，缺省: ${dockerName}"
    echo "      -h: 输出此信息"
    exit 1
}

while getopts "n:h" arg
do
    case "${arg}" in 
        n)
            dockerName="${OPTARG}"
            ;;
        *)
            usage
            ;;
    esac
done

containerID="${dockerName}"
clientUser="1172:502"
clientHome="/home/haitutech"

docker exec \
    -w ${clientHome} \
    -u ${clientUser} \
    -it \
    ${containerID} \
    "/bin/bash"
    
